package com.phgame.newsmth.task;

import java.util.Date;
import java.util.Vector;

import com.phgame.newsmth.ui.widget.PullToRefreshListView;
import com.phgame.newsmth.util.SmthCrawler;
import com.phgame.newsmth.data.*;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.widget.HeaderViewListAdapter;
import android.widget.ListView;
import com.phgame.newsmth.adapter.*;
public class GetUserInfoTask extends AsyncTask<String, Integer, String>{

	
	Handler handler ;
	public GetUserInfoTask(){
		
	}
	public GetUserInfoTask(Handler handler){
		//this.adapter = adapter;
		this.handler = handler;
	}
	
	@Override
	protected String doInBackground(String... params) {
		String username = params[0];
		String json = SmthCrawler.getInstance().getUserInfo(username);
		
		return json;
	
	}

	@Override
	protected void onPostExecute(String result) {
		Message msg = Message.obtain();
		Bundle data = new Bundle();
		data.putString("json", result);
		msg.setData(data);
		
		if(handler != null)
			handler.sendMessage(msg);
			
		super.onPostExecute(result);
	}
	
	
	
	
}
